<style>
    div .page-header-new{
        width:100%;
        height:50px;
        min-height:50px!important;
        line-height:50px;
        border-bottom:1px solid #666666!important;
    }
    .btn-header{
        border-radius: 0.5em;
        font-size:12px!important;
        margin-left:20px;
        margin-right:20px;
        background-color:#ffffff;
        border: 1px solid #666666;
    }
    .btn-new-friend{
        margin-left:80px;
        margin-right:60px;
    }
    .btn-display-left{
        margin-left:20px;
        margin-right:-2px;
        border-radius:0;
    }
    .btn-display-right{
        margin-left:-2px;
        margin-right:80px;
        border-radius:0;
    }
    .btn-delete{
        background-color:#ee162d;
    }
    .btn-active{
        background-color:#5dc2f1;
        border:none!important;
    }
    .btn{
        padding-left:30px!important;
        padding-right: 30px!important;
    }
    .title{
        font-size:20px;
        margin-left:50px;
        color:#0A0A0A;
    }
    #content-view{
        margin-top:20px;
    }
</style>
<div id="calendar-view-new" class="container" style="margin:0 0 0 0;padding:0 0 0 0">
    <div class="row page-header-new" style="margin:0 0 0 0">
        <div class="pull-left title" style="cursor:pointer">
            <div ng-show="displayMode==1||displayMode==2">个人企业资料</div>
            <div ng-show="displayMode==3||displayMode==4"><span ng-click="changeDisplayMode(1)">个人企业资料</span>&nbsp;>{{addCompanyInfo.companyBaseInfo.name}} </div>
        </div>
    </div>
    <div ng-show="displayMode!=3" class="row page-header-new">
        <div class="pull-left">
            <button class="btn btn-new-company btn-header" ng-click="changeDisplayMode(3)">新建公司</button>

            <button class="{{displayMode==1?'btn btn-display-left btn-header btn-active':'btn btn-display-left btn-header'}}" ng-click="changeDisplayMode(1)">列表展示</button>
            <button class="{{displayMode==2?'btn btn-display-right btn-header btn-active':'btn btn-display-right btn-header'}}" ng-click="changeDisplayMode(2)">层级展示</button>
            <input ng-show="displayMode==1" class="form-control" placeholder="搜索" ng-model="searchCompanyName" style="width:auto;display:inline"/>
        </div>
        <div class="pull-right">
            <div class="btn btn-display-left btn-header">导入</div>
            <div class="btn btn-display-right btn-header">导出</div>
            <div class="btn btn-delete btn-header" ng-click="deleteCompanys()">删除</div>
        </div>
    </div>
    <div class="content-view">
        <table style="margin-left:20px;margin-right:20px" ng-show="displayMode==1" class="datatable table table-hover dataTable">
            <thead>
            <tr>
                <th style="width:15%"><input type="checkbox" ng-click="selectAll($event)" ng-checked="isSelectedAll()"/>#</th>
                <th style="width:30%" class="{{orderKey!='name'?'sorting':reverse?'sorting_desc':'sorting_asc'}}" ng-click="orderByKey('name',$event)">名称</th>
                <th style="width:20%" class="{{orderKey!='startTime'?'sorting':reverse?'sorting_desc':'sorting_asc'}}" ng-click="orderByKey('startTime',$event)">联系方式</th>
                <th style="width:20%" class="{{orderKey!='endTime'?'sorting':reverse?'sorting_desc':'sorting_asc'}}" ng-click="orderByKey('endTime',$event)">成立时间</th>
                <th style="width:15%" class="{{orderKey!='isImportant'?'sorting':reverse?'sorting_desc':'sorting_asc'}}" ng-click="orderByKey('isImportant',$event)">直接上级</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in companyList|orderBy:orderList:reverse|filter:searchCompanyName">
                <td><input type="checkbox" name="selected" ng-checked="isSelected(item.id)" ng-click="updateSelection($event,item.id)"/>{{$index+1}}</td>
                <td ng-click="editCompany(item)">{{item.companyBaseInfo.name}}</td>
                <td ng-click="editCompany(item)">{{item.lineNumbers[0].lineNumber}}</td>
                <td ng-click="editCompany(item)">{{item.companyBaseInfo.foundDate|date:"yyyy年MM月dd日"}}</td>
                <td ng-click="editCompany(item)">{{item.parentName}}</td>
            </tr>
            </tbody>
        </table>
        <div ng-show="displayMode==2" style="margin-left:20px;margin-right:20px">
            <tree-view tree-data="recursionCompanyList" text-field="name" value-field="id" selected="selected"></tree-view>
        </div>
        <div ng-show="displayMode==3 || displayMode==4">
            <form name="addCompany" style="margin-top:35px">
                <div class="row">
                    <div class="col-md-1"></div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="companyName">公司名称</label>
                            <div class="col-md-10">
                                <input class="form-control" type="text" id="companyName" placeholder="必填" ng-model="addCompanyInfo.companyBaseInfo.name">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2" for="companyFoundTime">成立时间</label>
                            <div class="col-md-10">
                                <input class="form-control" type="date" id="companyFoundTime" placeholder="" ng-model="addCompanyInfo.companyBaseInfo.foundDate">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-1"></div>
                </div>
                <div style="margin-top: 20px" class="row">
                    <div class="col-md-1"></div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2" for="companyEnglishName">英文名</label>
                            <div class="col-md-10">
                                <input class="form-control" type="text" id="companyEnglishName" placeholder="" ng-model="addCompanyInfo.companyBaseInfo.englishName">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2" for="registerCapital">注册资金</label>
                            <div class="col-md-10">
                                <input class="form-control" type="text" id="registerCapital" placeholder="注册资金(人民币)" ng-model="addCompanyInfo.companyBaseInfo.registerCapital">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-1"></div>
                </div>
                <div style="margin-top:20px" class="row">
                    <div class="col-md-1"></div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2 control-label" for="companyAlias">别名</label>
                            <div class="col-md-10">
                                <input class="col-sm-10 form-control" type="text" id="companyAlias" placeholder="" ng-model="addCompanyInfo.companyBaseInfo.alias">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2" for="businessConnectionWithMe">业务关联</label>
                            <div class="col-md-10">
                                <select class="form-control" id="businessConnectionWithMe" ng-model="addCompanyInfo.businessConnectionWithMe" ng-options="x.value as x.name for x in businessConnectionList">
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-1"></div>
                </div>
                <div style="margin-top:20px" class="row">
                    <div class="col-md-1"></div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2"  for="webSite">网址</label>
                            <div class="col-md-10">
                                <input class="form-control" type="text" id="webSite" placeholder="" ng-model="addCompanyInfo.companyBaseInfo.webSite">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2" for="importanceToMe">重要程度</label>
                            <div class="col-md-10">
                                <select class="form-control" id="importanceToMe" ng-model="addCompanyInfo.importanceToMe" ng-options="x.value as x.name for x in importanceList"></select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-1"></div>
                </div>
                <div style="margin-top:20px" class="row">
                    <div class="col-md-1"></div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2"  for="webSite">直接上级</label>
                            <div class="col-md-10">
                                <input class="form-control" type="text" id="parentCompany" placeholder="" ng-model="addCompanyInfo.parentCompanyName" ng-click="selectParentCompany()">
                            </div>
                        </div>
                    </div>
                    <div class="col-md-5">
                        <div class="form-group">
                            <label class="col-md-2" for="friendshipWithMe">相互关系</label>
                            <div class="col-md-10">
                                <select class="form-control" id="friendshipWithMe" ng-model="addCompanyInfo.friendshipWithMe" ng-options="x.value as x.name for x in friendShipList"></select>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-1"></div>
                </div>
                <div style="margin-top:20px" class="row">
                    <div class="col-md-1"></div>
                    <div class="col-md-10">
                        <label class="col-md-1" for="overview">简介</label>
                        <div class="col-md-11">
                            <textarea id="overview" class="form-control" style="height:100px" ng-model="addCompanyInfo.companyBaseInfo.overview"></textarea>
                        </div>
                    </div>
                </div>

                <div class="row" style="margin-top:20px">
                    <div class="col-md-1"></div>
                    <div class="col-md-8">
                        <div class="box border clearfix">
                            <div class="box-title">
                                联系方式
                                <div class="tools"><i ng-click="addLineNumber()" class="fa fa-plus-circle"></i></div>
                            </div>
                            <div class="box-body">
                                <div class="row" style="margin-top:10px" ng-repeat="item in addCompanyInfo.lineNumbers track by $index">
                                    <div class="col-md-2"><input class="form-control" ng-model="item.lineName" placeholder="说明"/></div>
                                    <div class="col-md-8"><input class="form-control" ng-model="item.lineNumber" placeholder="号码"/></div>
                                    <div class="col-md-2"><i ng-click="deleteLineNumber($index)" class="fa fa-minus-circle"></i></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row" style="margin-top:20px">
                    <div class="col-md-1"></div>
                    <div class="col-md-8">
                        <div class="box border clearfix">
                            <div class="box-title">
                                地址
                                <div class="tools"><i ng-click="addAddress()" class="fa fa-plus-circle"></i></div>
                            </div>
                            <div class="box-body">
                                <div class="row" style="margin-top:20px;margin-left:15px" ng-repeat="x in addCompanyInfo.addresss track by $index">
                                    <div>
                                        <div class="row">
                                            <div class="col-md-2">四级地址</div>
                                            <div class="col-md-8">
                                                <city-four-select province="x.province" city="x.city" district="x.district" street="x.street"></city-four-select>
                                            </div>
                                            <div class="col-md-2"><i class="fa fa-minus-circle" ng-click="deleteAddress($index)"></i></div>
                                        </div>
                                        <div style="margin-top:10px" class="row">
                                            <div class="col-md-2">详细地址</div>
                                            <div class="col-md-8"><input class="form-control" ng-model="x.detailAddress"/></div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div style="margin-top: 15px" class="form-group">
                    <div class="row" style="padding-left:15px;padding-right:15px;">
                        <div class="col-md-4"></div>
                        <div class="col-md-1" >
                            <input type="button" class="btn btn-warning" value="重置" ng-click="clear(1)">
                        </div>
                        <div class="col-md-1">
                            <input type="button" class="btn btn-success" value="提交" ng-disabled="addCompanyInfo.companyBaseInfo.name==''" ng-click="saveCompanyInfo()">
                        </div>
                        <div class="col-md-4"></div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>